<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <script type="text/javascript">
			var path="<%=path%>";
	</script>
    <title>企业需求方认证展示页面</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script type="text/javascript" src="<%=path%>/js/jquery/jquery-1.10.2.min.js"></script>
	<script type="text/javascript" src="<%=path%>/js/extJquery.js"></script>
	<script type="text/javascript" src="<%=path %>/js/adminLogin.js"></script>
	<script type="text/javascript" language="javascript"> 
	$(function(){ 
		$("#orgRegLocationCode0").unbind("change", eDropLangChange).bind("change", eDropLangChange); 
		$("#orgRegLocationCode").unbind("change", eDropFrameChange).bind("change", eDropFrameChange); 
	}); 
	var eDropLangChange = function(){ 
		var selectedValue = $(this).val(); 
		$("#orgRegLocationCode").children("span").each(function(){ 
			$(this).children().clone().replaceAll($(this)); 
		}); 

		if(parseInt(selectedValue) != 0){ 
			$("#orgRegLocationCode").children("option[parentid!='" + selectedValue + "'][value!='0']").each(function(){ 
				$(this).wrap("<span style='display:none'></span>"); 
			}); 
		} 
	}; 
	var eDropFrameChange = function(){  
		$("#orgRegLocationCode0").val($(this).children("option:selected").attr("parentid")); 
	}; 
	
	
	
	/*	2014年9月1日21:36:07                          */
	/*=======================================*/
	$(document).ready(function(){
		
	});
	
	//表单提交新增失败后,返回回调函数,传回错误信息
	function uploadSucced(msg){
	//	var btn = $("#createPeriadBtn");
	//	btn.button('reset');
		$("#firstUploadSucceedMsg").html(msg);
		$("#firstUploadSucceed").show();
		$("#firstUploadFailed").hide();
		var strs = new Array();
		strs = msg.split("&");
		if(strs[1]=="1"){
			document.getElementById("userCertFrontPhotoImg").src=path + strs[0];
			$("#userCertFrontPhotoUrlInput").val(strs[0]);
		}else if(strs[1]=="0"){
			document.getElementById("userCertObversePhotoImg").src=path + strs[0];
			$("#userCertObversePhotoUrlInput").val(strs[0]);
		}else if(strs[1]=="2"){
			document.getElementById("orgBusinessCertPhotoImg").src=path + strs[0];
			$("#orgBusinessCertPhotoUrlInput").val(strs[0]);
		}else if(strs[1]=="3"){
			document.getElementById("orgTaxRegCertPhotoImg").src=path + strs[0];
			$("#orgTaxRegCertPhotoUrlInput").val(strs[0]);
		}
	}
	//表单提交修改失败后，传回提示信息
	function uploadFailed(msg){
	//	var btn = $("#updateperiadBtn");
	//	btn.button('reset');
		$("#firstUploadFailedMsg").html(msg);
		$("#firstUploadFailed").show();
		$("#firstUploadSucceed").hide();
	}
	
	</script> 
  </head>
  
  <body style="text-align: center">
    <h1>这里是企业需求方认证页面</h1>
    <br>
 	<form id="comDemindCertifyForm" >
 	
     	<div id="errmsg"  style="color: #FFFFFF; font-size: 12px; ">&nbsp;</div>
		<br>
		*当前申请人姓名:<input type="text" readonly="readonly" name="userName" id="userName" value="${user.userName}">
		<br>
		*申请人证件类型:<select id="userCertTypeCode" name="userCertTypeCode">
					<c:if test="${!empty certs}">
						<c:forEach var="cert" items="${certs}">
							<c:if test="${cert.codeId==user.userCertTypeCode}">
								<option value="${cert.codeId }" selected="selected">${cert.codeDesc}</option>
							</c:if>
							<%-- <c:if test="${cert.codeId!=user.userCertTypeCode}">
								<option value="${cert.codeId }">${cert.codeDesc}</option>
							</c:if> --%>
						</c:forEach>
					</c:if>
                 </select>
		<br>
		*申请人证件号码:<input type="text" readonly="readonly" name="userCertNo" value="${user.userCertNo }" id="userCertNo" >
		<br>
		
		
		*申请人手机号码:<input type="text" readonly="readonly" value="${user.userMobile }" name="userMobile" id="userMobile" >
		<br>
		*申请人电子邮箱:<input type="text" readonly="readonly" name="userEmail" id="userEmail" value="${user.userEmail }">
		<br>
		*公司注册所在地区:<select id="orgRegLocationCode0" name="orgRegLocationCode0"> 
					<option value="0" selected="selected">--省份--</option> 
					<c:if test="${!empty locations}">
						<c:forEach var="location" items="${locations}">
							<c:if test="${location.locationCode==location.pLocationCode}">
								<c:if test="${location.locationCode==(user.orgRegLocationCode/1000)}">
									<option value="${location.locationCode}" selected="selected">${location.locationName}</option>
								</c:if>
								<%-- <c:if test="${location.locationCode!=(user.orgRegLocationCode/1000)}">
									<option value="${location.locationCode}">${location.locationName}</option>
								</c:if> --%>
							</c:if>
						</c:forEach>
					</c:if> 
				</select> 
				<select id="orgRegLocationCode" name="orgRegLocationCode"> 
					<option value="0" selected="selected">--城市-- </option>
					<c:if test="${!empty locations}">
						<c:forEach var="location" items="${locations}">
							<c:if test="${location.locationCode!=location.pLocationCode}">
								<c:if test="${location.locationCode==user.orgRegLocationCode }">
									<option value="${location.locationCode}" parentid="${location.pLocationCode}" selected="selected">${location.locationName}</option>
								</c:if>
								<%-- <c:if test="${location.locationCode!=user.orgRegLocationCode }">
									<option value="${location.locationCode}" parentid="${location.pLocationCode}" >${location.locationName}</option>
								</c:if> --%>
							</c:if>
						</c:forEach>
					</c:if> 
				</select> 

		<br>
		*公司注册详细地址:<input type="text" readonly="readonly" name="orgRegAddr" value="${user.orgRegAddr }" id="orgRegAddr" >
		<br>
		*申请人当前职务:<input type="text" readonly="readonly" name="userCurrPosition" value="${user.userCurrPosition }" id="userCurrPosition" >
		<br>
		税务登记证编号:<input type="text" readonly="readonly" name="orgTaxRegCertNo" value="${user.orgTaxRegCertNo }" id="orgTaxRegCertNo" ></div>
		<br>
		*企业名称:<input type="text" readonly="readonly" value="${user.orgName}" name="orgName" id="orgName" >
		<br>
		*企业法人姓名:<input type="text" readonly="readonly" value="${user.orgLawfulManName}" name="orgLawfulManName" id="orgLawfulManName" >    
		<br>
		企业组织机构代码:<input type="text" readonly="readonly" name="orgCode" value="${user.orgCode }" id="orgCode" >
		<br>
		*个人说明:<input type="text" readonly="readonly" name="userDesc" value="${user.userDesc }" id="userDesc" >
		<br>
		*企业经营范围:<c:if test="${!empty targets}">
			<c:forEach var="cert" items="${targets}">
				<c:if test="${cert.recordStatusCode=='2'}">
					<input type="checkbox" name="targets" value="${cert.targetCode}" checked="checked"> ${cert.targetName} 
				</c:if>
				<%-- <c:if test="${cert.recordStatusCode!=2}">
					<input type="checkbox" name="targets" value="${cert.targetCode}"> ${cert.targetName} 
				</c:if> --%>
			</c:forEach>
		</c:if>
		<br>
		*备注:<input type="text" readonly="readonly" value="${user.remark}" name="remark" id="remark" >

		
		<input type="hidden" value="${user.userCertFrontPhotoUrl}" name="userCertFrontPhotoUrl" id="userCertFrontPhotoUrlInput" >    
		<input type="hidden" value="${user.userCertObversePhotoUrl}" name="userCertObversePhotoUrl" id="userCertObversePhotoUrlInput" >    
		<input type="hidden" value="${user.orgBusinessCertPhotoUrl}" name="orgBusinessCertPhotoUrl" id="orgBusinessCertPhotoUrlInput" >    
		<input type="hidden" value="${user.orgTaxRegCertPhotoUrl}" name="orgTaxRegCertPhotoUrl" id="orgTaxRegCertPhotoUrlInput" >    
	
	</form>

   	<form id ="firstUpdateForm" action="<%=path%>/user/uploadFile.do?imgType=1" method="post"
	    enctype="multipart/form-data" class="form-horizontal" role="form" target="hidden_frame">
		    申请人证件正面:<!-- <input type="file" id="firstDemoImgFile" name="imgFile"> -->
		<%=path%>
		${user.userCertFrontPhotoUrl != null}
		${user.userCertFrontPhotoUrl != null}
		<c:if test="${user.userCertFrontPhotoUrl != null}">
			<br>
			<img style="width:200px;" id="userCertFrontPhotoImg" src="<%=path%>${user.userCertFrontPhotoUrl}" />
			<br>
		</c:if>
		<c:if test="${user.userCertFrontPhotoUrl == null}">
			<br>
			<img style="width:200px;" id="userCertFrontPhotoImg" src="<%=path%>/img/test.jpg" />
			<br>
		</c:if>
		
	    <button id="createPeriadBtn" type="submit" class="btn btn-default">上传</button>
	</form> 
	
	<form id ="firstUpdateForm" action="<%=path%>/user/uploadFile.do?imgType=0" method="post"
	    enctype="multipart/form-data" class="form-horizontal" role="form" target="hidden_frame">
		    申请人证件反面:<!-- <input type="file" id="firstDemoImgFile" name="imgFile"> -->
		<c:if test="${user.userCertObversePhotoUrl != null}">
			<br>
			<img style="width:200px;" id="userCertObversePhotoImg"src="<%=path%>${user.userCertObversePhotoUrl}" />
			<br>
		</c:if>
		<c:if test="${user.userCertObversePhotoUrl == null}">
			<br>
			<img style="width:200px;" id="userCertObversePhotoImg"src="<%=path%>/img/test.jpg" />
			<br>
		</c:if>
	    <button id="createPeriadBtn" type="submit" class="btn btn-default">上传</button>
	</form> 
	
	<form id ="firstUpdateForm" action="<%=path%>/user/uploadFile.do?imgType=2" method="post"
	    enctype="multipart/form-data" class="form-horizontal" role="form" target="hidden_frame">
		    营业执照证件上传:<!-- <input type="file" id="firstDemoImgFile" name="imgFile"> -->
		<c:if test="${user.orgBusinessCertPhotoUrl != null}">
			<br>
			<img style="width:200px;" id="orgBusinessCertPhotoImg"src="<%=path%>${user.orgBusinessCertPhotoUrl}" />
			<br>
		</c:if>
		<c:if test="${user.orgBusinessCertPhotoUrl == null}">
			<br>
			<img style="width:200px;" id="orgBusinessCertPhotoImg"src="<%=path%>/img/test.jpg" />
			<br>
		</c:if>
	    <button id="createPeriadBtn" type="submit" class="btn btn-default">上传</button>
	</form> 
	
	<form id ="firstUpdateForm" action="<%=path%>/user/uploadFile.do?imgType=3" method="post"
	    enctype="multipart/form-data" class="form-horizontal" role="form" target="hidden_frame">
		    税务登记证件上传:<!-- <input type="file" id="firstDemoImgFile" name="imgFile"> -->
		<c:if test="${user.orgTaxRegCertPhotoUrl != null}">
			<br>
			<img style="width:200px;" id="orgTaxRegCertPhotoImg"src="<%=path%>${user.orgTaxRegCertPhotoUrl}" />
			<br>
		</c:if>
		<c:if test="${user.orgTaxRegCertPhotoUrl == null}">
			<br>
			<img style="width:200px;" id="orgTaxRegCertPhotoImg"src="<%=path%>/img/test.jpg" />
			<br>
		</c:if>
	    <button id="createPeriadBtn" type="submit" class="btn btn-default">上传</button>
	</form> 
	
	<!-- <div id="firstUploadSucceed" style="display: none;">
	    <strong>文件上传成功！</strong><span id="firstUploadSucceedMsg"></span>
	</div>
	<div id="firstUploadFailed" style="display: none;">
	    <strong>对不起！文件上传失败！</strong><span id="firstUploadFailedMsg"></span>
	</div>
	<iframe name='hidden_frame' id="hidden_frame" style='display:none'></iframe>
	<a href="javascript:comDemindCertify();">提交</a> -->
  </body>
</html>
